package com.xiu.thread;

import java.util.concurrent.locks.LockSupport;

public class Demo1 {
	private static char[] arr1 = "123456".toCharArray();
	private static char[] arr2 = "abcdef".toCharArray();

	public static void main(String[] args) {
		Thread t1 = new Thread(new Runnable() {

			public void run() {
				for (char c : arr1) {
					LockSupport.park();
					System.out.println(c);
					
				}

			}
		});

		Thread t2 = new Thread(new Runnable() {

			public void run() {
				for (char c : arr2) {
					System.out.println(c);
				}

			}
		});
		t1.start();
		t2.start();
	}

}
